// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   getBalance.java

package fund;

import include.nseer_db.nseer_db;
import java.sql.ResultSet;

public class getBalance
{

	private String sql;
	private ResultSet rs;
	private double cost_price_sum;

	public getBalance()
	{
		sql = "";
		rs = null;
		cost_price_sum = 0.0D;
	}

	public double balance(String unit_db_name, String first_ID, String first_name, String currency_name)
	{
		nseer_db dba = new nseer_db(unit_db_name);
		try
		{
			sql = (new StringBuilder("select * from fund_balance_details where fund_chain_ID='")).append(first_ID).append("' and fund_chain_name='").append(first_name).append("' and currency_name='").append(currency_name).append("'").toString();
			rs = dba.executeQuery(sql);
			if (rs.next())
				cost_price_sum = rs.getDouble("cost_price_sum");
			else
				cost_price_sum = 0.0D;
			dba.close();
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
		return cost_price_sum;
	}
}
